FROM openanolis/anolisos:8.6

LABEL maintainer="OpenAnolis Cloud Native SIG"

RUN yum -y update \
    && yum -y install nginx \
    && yum clean all

# forward request and error logs to docker log collector
RUN ln -sf /dev/stdout /var/log/nginx/access.log \
    && ln -sf /dev/stderr /var/log/nginx/error.log \
# check if we have ipv6 available
    && if [ ! -f "/proc/net/if_inet6" ]; then \
        sed -i '/listen       \[::\]:80 default_server;/d' "/etc/nginx/nginx.conf"; \
    fi

EXPOSE 80

STOPSIGNAL SIGTERM

CMD ["nginx", "-g", "daemon off;"]
